package Timer;

public class MyTimerTask implements Comparable<MyTimerTask>{
    private long time;
    private Runnable task;
    public MyTimerTask(long time,Runnable runnable){
        this.task=runnable;
        this.time=time;
    }

    public long getTime() {
        return time;
    }

    public Runnable getTask() {
        return task;
    }

    public void setTime(long time) {
        this.time = time;
    }

    public void setTask(Runnable task) {
        this.task = task;
    }
    public void run(){
        task.run();
    }
    @Override
    public int compareTo(MyTimerTask o) {
        return Long.compare(this.time,o.time);
    }
}
